import { postRequest, postRequestList, postRequestJson, delRequestPost, postRequestData } from '../utils/request'
export const getDictList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/systemDictData/getPageDataInfo`, data)

export const detailDictById = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/systemDictData/getInfoById`, data)

export const addDict = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/systemDictData/create`, data)

export const editDict = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/systemDictData/update`, data)

export const delDictById = <T>(data?: any): Promise<IResponseData<T>> =>
  delRequestPost(`/api/sop/sop/systemDictData/delete`, data)

export const getDictTypeList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/systemDictType/pageList`, data)

export const detailDictTypeById = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/systemDictType/getInfoById`, data)

export const addDictType = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/systemDictType/create`, data)

export const editDictType = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/systemDictType/update`, data)

export const delDictTypeById = <T>(data?: any): Promise<IResponseData<T>> =>
  delRequestPost(`/api/sop/sop/systemDictType/delete`, data)

export const getAllDictData = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/systemDictData/mapDictData`, data)
